const Controller = require('egg').Controller;

class HomeController extends Controller {
    async index() {
    //   this.ctx.body = 'Hello world';
      this.ctx.body=await this.app.mysql.query(`select 1+1;`); // 单实例可以直接通过 app.mysql 访问
    }

    async wxlogin() {
        var redirect_uri = encodeURIComponent('123123')
        var appid = ""
        var url = `https://open.weixin.qq.com/connect/qrconnect?appid=${appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect`
        // return this.redirect("https://baidu.com")

    }

  }
  
  module.exports = HomeController;